package com.snippeteer.infrastructure.presistence.impl;

import org.springframework.stereotype.Repository;

import com.snippeteer.domain.User;
import com.snippeteer.infrastructure.presistence.UserRepository;

@Repository
public class UserRepositoryImpl implements UserRepository{

	@Override
	public User getUser(Integer id) {
		User user = User.findById(id);
		return user;
	}

	@Override
	public User saveUser(String username, String password) {
		User user = new User();
		user.setUsername(username);
		user.setPassword(password);
		user.persist();
		return user;
	}
	
}
